package inits

import (
	"net/http"
	"time"
	"user_srv/basic/config"
)

type BaiduFaceClient struct {
	APIKey    string       // 百度云API Key
	SecretKey string       //百度云Secret Key
	client    *http.Client // HTTP客户端(带超时控制)
}

// NewBaiduFaceClient 创建客户端实例(初始化HTTP超时)
func NewBaiduFaceClient() *BaiduFaceClient {
	config.AppCong.BaiduFace.Client = &http.Client{
		Timeout: 5 * time.Second,
	}
	return &BaiduFaceClient{
		APIKey:    config.AppCong.BaiduFace.ApiKey,
		SecretKey: config.AppCong.BaiduFace.SecretKey,
		client:    config.AppCong.BaiduFace.Client,
	}
}
